package cn.chainco.cts.iserviceImpl;

import java.util.List;
import java.util.Map;

import cn.chainco.cts.idao.IUserDao;
import cn.chainco.cts.iservice.IUserManager;
import cn.chainco.cts.jdo.User;
import cn.chainco.cts.utils.query.Page;
import cn.chainco.cts.utils.query.QueryOrder;
import cn.chainco.cts.utils.query.QueryParam;

@SuppressWarnings("unchecked")
public class UserManagerImpl extends CommonManagerImpl implements IUserManager{
	private IUserDao userDao;

	public IUserDao getUserDao(){
		return userDao;
	}

	public void setUserDao(IUserDao userDao){
		this.userDao = userDao;
	}

	public User findByNameAndPass(final String name , final String pwd) {
		return userDao.findByNameAndPass(name, pwd);
	}

	public List<User> findByName(final String name){
		return userDao.findByName(name);
	}
	
	public <E>List<E> findSqlByElist(String sql , Class className, Map<String , String> mp){
		return userDao.findSqlByElist(sql ,  className,  mp);
	}

	public List<User> findUser(String userName , String createTime , Integer status , Map<String , String> searchCond){
		return this.userDao.findUser(userName, createTime, status, searchCond);
	}
	
	/**
	 * 删除用户和相关连的数据
	 * @param company
	 * @return
	 */
	public int delUserByAll(User user){
		return this.userDao.delUserByAll(user);
	}

}
